
// async函数返回值不添加await关键字时就是同步函数

function request(url) {
    return new Promise((res, rej) => {
        setTimeout(() => {
            res(url)
        }, 1000)
    })
}
async function foo() {
    const res = await request(111)
    console.log(res);
    return Promise.reject(true)
}
async function bar() {
    try {
        const res = await foo()
        console.log(res);
    } catch (error) {
    }
}
bar()